﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BussinessObject;

public partial class WebApplication_ADSendEmail : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if(!Page.IsPostBack)
        {
            if (Convert.ToInt32(Session["RoleCode"]) != 2)
            {
                if (Session["email"] != null)
                {
                    txtTo.Text = Session["email"].ToString();
                }
            }
            else
                Response.Redirect("ADAccounts.aspx");
        }
    }
    protected void btSubmit_Click(object sender, EventArgs e)
    {
        BOQuoteUs boqu = new BOQuoteUs();
        boqu.Reply_QuoteUs(txtTo.Text, txtSubject.Text, txtContent.Text);
        HttpContext.Current.Response.Write("<script type='text/javascript'>alert('" + "Email has been sent ..." + "');window.location.href='ADResume.aspx';</script>");
    }
    protected void btReset_Click(object sender, EventArgs e)
    {
        txtTo.Text = "";
        txtSubject.Text = "";
        txtContent.Text = "";
    }
}